Param ($file)

if ($file -eq $null) {break}

$asu = import-csv $file

$au =@()

foreach ($user in $asu) {
	$cas = Get-CASMailbox $user.email
	$au1 = New-Object PSObject
	$au1 | Add-Member NoteProperty Email $user.email
	$au1 | Add-Member NoteProperty ActiveSyncMailboxPolicy $cas.ActiveSyncMailboxPolicy
	$au1 | Add-Member NoteProperty ActiveSyncMailboxPolicyIsDefaulted $cas.ActiveSyncMailboxPolicyIsDefaulted
	$au += $au1
}
$au | export-csv -notype "ActiveSyncUsersWithPolicy.csv"